home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part2 / 11834 < prev    next >
Encoding:
Text File  |  1996-08-05  |  1.4 KB  |  43 lines

  1. Path: isonews.bbn.hp.com!hpbblb!news
  2. From: Matthias Dittrich <matti>
  3. Newsgroups: comp.lang.c
  4. Subject: Re: Newbie doesn't understand compiler error
  5. Date: 26 Mar 1996 17:21:32 GMT
  6. Organization: Hewlett-Packard Co.
  7. Message-ID: <4j992s$gcr@hpbblb.bbn.hp.com>
  8. References: <Pine.SUN.3.91.960301153010.11258B-100000@pioneer.uspto.gov> <4hoffl$l74@aphex.direct.ca> <4irlub$jtn@winx03.informatik.uni-wuerzburg.de>
  9. NNTP-Posting-Host: trabant.bbn.hp.com
  10. Mime-Version: 1.0
  11. Content-Type: text/plain; charset=us-ascii
  12. Content-Transfer-Encoding: 7bit
  13. X-Mailer: Mozilla 1.1N (X11; I; HP-UX A.09.07 9000/712)
  14. X-URL: news:4irlub$jtn@winx03.informatik.uni-wuerzburg.de
  15.  
  16. schoof@informatik.uni-wuerzburg.de (Jochen Schoof) wrote:
  17. >Ed Toivanen (etoivane@direct.ca) wrote:
  18. >:  
  19. >: >
  20. >: >main( int argv, char *argc[] )  <<- Compiler states "Syntax error at or near
  21. >:
  22. >: Try 
  23. >:  main(int argc, char* argv[])
  24. >:
  25. >: That should fixn things up.
  26. >
  27. >I don't see why. If the program does not compile with the given
  28. >definition it most likely won't do so either with your suggestion.
  29. >The names of variables can be chosen arbitrarily - even for the
  30. >parameters of main(). Using argc as the argument counter and
  31. >argv as the pointer to the arguments is sort of convention, but
  32. >not required by the standard. Interchanging these two is not the
  33. >best idea but however legal C.
  34. >
  35. May be you have no ANSI-C compiler. Then try:
  36. int main(argc, argv)
  37. int argc;
  38. char *argv[];
  39.  
  40. Good luck,
  41. Matthias
  42.  
  43.